
from concurrent import futures
from datetime   import datetime

import grpc
import async_pb2
import async_pb2_grpc
import asyncio

class RouteGuideServicer(async_pb2_grpc.RouteGuideServicer):
    """Provides methods that implement functionality of route guide server."""
    async def GetFeature(self, request, context):
        print(datetime.now(),'\n',request)
        return async_pb2.Feature(name="abc", location=request)

async def server():
    server = grpc.aio.server(maximum_concurrent_rpcs=100)
    async_pb2_grpc.add_RouteGuideServicer_to_server(        
        RouteGuideServicer(), server)

    server.add_insecure_port('[::]:50051')
    await server.start()
    await server.wait_for_termination()


if __name__ == '__main__':
    asyncio.run(server()) 
        
